package com.distribute.framework.model;

import com.distribute.framework.core.web.helper.Utils;
import java.lang.reflect.Field;
import java.util.Date; 
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;

import javax.annotation.Resource;

import com.distribute.framework.core.web.util.Page;
import com.distribute.framework.core.lang.*; 
import com.distribute.framework.core.web.helper.WebHelper.LzMap;
import com.distribute.framework.core.util.Function;
import com.distribute.framework.core.util.IbatisMap;
import com.distribute.framework.config.*;
import com.distribute.framework.plugin.*;

@namespace("finance/jxshincome")
public @caption("经销商收益") @database(DatabaseNames.distribute_sys) @source("distribute_sys") @table("tb_jxsh_income") class TbJxshIncome implements java.io.Serializable
{
	private static final long serialVersionUID = 1l;
		
	
		
	private @caption("编号") @column("tbji_id")    @primary  @notnull  @note("  ") Long tbjiId;// 主键 非空     
			
 			
 			
 		
	
		
	private @caption("所属品牌") @column("tbji_merchant")     @notnull  @relate("$tbjiMerchant") @RelateClass(Merchant.class)  @note("  ") Long tbjiMerchant;// 非空     
			
 	private transient Merchant $tbjiMerchant;//关联对象[品牌信息]
 			
 			
 			
 		
	
		
	private @caption("经销商") @column("tbji_jxsh")     @notnull  @relate("$tbjiJxsh") @RelateClass(TbJxsh.class)  @note("  ") Long tbjiJxsh;// 非空     
			
 	private transient TbJxsh $tbjiJxsh;//关联对象[经销商]
 			
 			
 			
 		
	
		
	private @caption("经销商名称") @column("tbji_jxs_name") @like     @note("  ") String tbjiJxsName;//     
			
 			
 			
 		
	
		
	private @caption("订单编号") @column("tbji_order_id")     @notnull  @note("  ") Long tbjiOrderId;// 非空     
			
 			
 			
 		
	
		
	private @caption("订单时间") @column("tbji_order_time")      @note("  ") Date tbjiOrderTime;//     
			
 			
 			
 		
	
		
	private @caption("下单人") @column("tbji_member") @like     @note("  ") String tbjiMember;//     
			
 			
 			
 		
	
		
	private @caption("配送商") @column("tbji_distributor") @like     @note("  ") String tbjiDistributor;//     
			
 			
 			
 		
	
		
	private @caption("订单类别") @column("tbji_type")      @note(" 1:直接购买订单 2:余额提货订单  ") Short tbjiType;// 1:直接购买订单 2:余额提货订单     
			
 			
 			
 		
	
		
	private @caption("订单明细") @column("tbji_order_details") @like  @hidden    @note(" query:goodsNumber text:name menoy:price number:number select:status  ") String tbjiOrderDetails;// query:goodsNumber text:name menoy:price number:number select:status     
			
 			
 			
 		
	
		
	private @caption("收益金额") @column("tbji_money")     @notnull  @note("  ") Double tbjiMoney;// 非空     
			
 			
 			
 		
	
		
	private @caption("获得时间") @column("tbji_time")     @notnull  @note("  ") Date tbjiTime;// 非空     
			
 			
 			
 		
	
	 
	//默认构造函数
	public TbJxshIncome(){ 
	
	}
	
	//主键构造函数
	public TbJxshIncome(Long id){
		this.tbjiId = id;
	}
	
	/**所有字段构造函数 
	 TbJxshIncome(
	 	Utils.getLong("merchant")//所属品牌 [非空]
	 	,Utils.getLong("jxsh")//经销商 [非空]
	 	,Utils.getString("jxsName")//经销商名称
	 	,Utils.getLong("orderId")//订单编号 [非空]
	 	,Utils.getDate("orderTime")//订单时间
	 	,Utils.getString("member")//下单人
	 	,Utils.getString("distributor")//配送商
	 	,Utils.getShort("type")//订单类别
	 	,Utils.getString("orderDetails")//订单明细
	 	,Utils.getDouble("money")//收益金额 [非空]
	 	,Utils.getDate("time")//获得时间 [非空]
	 )
	**/
	public TbJxshIncome(Long tbjiMerchant,Long tbjiJxsh,String tbjiJxsName,Long tbjiOrderId,Date tbjiOrderTime,String tbjiMember,String tbjiDistributor,Short tbjiType,String tbjiOrderDetails,Double tbjiMoney,Date tbjiTime){
		
			
			
		this.tbjiMerchant=tbjiMerchant;
		
			
		this.tbjiJxsh=tbjiJxsh;
		
			
		this.tbjiJxsName=tbjiJxsName;
		
			
		this.tbjiOrderId=tbjiOrderId;
		
			
		this.tbjiOrderTime=tbjiOrderTime;
		
			
		this.tbjiMember=tbjiMember;
		
			
		this.tbjiDistributor=tbjiDistributor;
		
			
		this.tbjiType=tbjiType;
		
			
		this.tbjiOrderDetails=tbjiOrderDetails;
		
			
		this.tbjiMoney=tbjiMoney;
		
			
		this.tbjiTime=tbjiTime;
		
	}
	
	//设置非空字段
	public TbJxshIncome setNotNull(Long tbjiMerchant,Long tbjiJxsh,Long tbjiOrderId,Double tbjiMoney,Date tbjiTime){
		
			
			
		this.tbjiMerchant=tbjiMerchant;
		
			
		this.tbjiJxsh=tbjiJxsh;
		
			
			
		this.tbjiOrderId=tbjiOrderId;
		
			
			
			
			
			
			
		this.tbjiMoney=tbjiMoney;
		
			
		this.tbjiTime=tbjiTime;
		
		return this;
	}
	
	
		
	/** 编号 [非空]       **/
	public TbJxshIncome tbjiId(Long tbjiId){
		this.tbjiId = tbjiId;
		this.setSeted(F.tbjiId);
		return this;
	}
	
		
	/** 所属品牌 [非空] [Merchant]      **/
	public TbJxshIncome tbjiMerchant(Long tbjiMerchant){
		this.tbjiMerchant = tbjiMerchant;
		this.setSeted(F.tbjiMerchant);
		return this;
	}
	
		
	/** 经销商 [非空] [TbJxsh]      **/
	public TbJxshIncome tbjiJxsh(Long tbjiJxsh){
		this.tbjiJxsh = tbjiJxsh;
		this.setSeted(F.tbjiJxsh);
		return this;
	}
	
		
	/** 经销商名称        **/
	public TbJxshIncome tbjiJxsName(String tbjiJxsName){
		this.tbjiJxsName = tbjiJxsName;
		this.setSeted(F.tbjiJxsName);
		return this;
	}
	
		
	/** 订单编号 [非空]       **/
	public TbJxshIncome tbjiOrderId(Long tbjiOrderId){
		this.tbjiOrderId = tbjiOrderId;
		this.setSeted(F.tbjiOrderId);
		return this;
	}
	
		
	/** 订单时间        **/
	public TbJxshIncome tbjiOrderTime(Date tbjiOrderTime){
		this.tbjiOrderTime = tbjiOrderTime;
		this.setSeted(F.tbjiOrderTime);
		return this;
	}
	
		
	/** 下单人        **/
	public TbJxshIncome tbjiMember(String tbjiMember){
		this.tbjiMember = tbjiMember;
		this.setSeted(F.tbjiMember);
		return this;
	}
	
		
	/** 配送商        **/
	public TbJxshIncome tbjiDistributor(String tbjiDistributor){
		this.tbjiDistributor = tbjiDistributor;
		this.setSeted(F.tbjiDistributor);
		return this;
	}
	
		
	/** 订单类别    1:直接购买订单 2:余额提货订单     **/
	public TbJxshIncome tbjiType(Short tbjiType){
		this.tbjiType = tbjiType;
		this.setSeted(F.tbjiType);
		return this;
	}
	
		
	/** 订单明细    query:goodsNumber text:name menoy:price number:number select:status     **/
	public TbJxshIncome tbjiOrderDetails(String tbjiOrderDetails){
		this.tbjiOrderDetails = tbjiOrderDetails;
		this.setSeted(F.tbjiOrderDetails);
		return this;
	}
	
		
	/** 收益金额 [非空]       **/
	public TbJxshIncome tbjiMoney(Double tbjiMoney){
		this.tbjiMoney = tbjiMoney;
		this.setSeted(F.tbjiMoney);
		return this;
	}
	
		
	/** 获得时间 [非空]       **/
	public TbJxshIncome tbjiTime(Date tbjiTime){
		this.tbjiTime = tbjiTime;
		this.setSeted(F.tbjiTime);
		return this;
	}
	
	
	
	/**
	* 克隆对象
	**/
	public TbJxshIncome clone(){
		TbJxshIncome clone = new TbJxshIncome();
		
			
			
		clone.tbjiMerchant=this.tbjiMerchant;
		
			
		clone.tbjiJxsh=this.tbjiJxsh;
		
			
		clone.tbjiJxsName=this.tbjiJxsName;
		
			
		clone.tbjiOrderId=this.tbjiOrderId;
		
			
		clone.tbjiOrderTime=this.tbjiOrderTime;
		
			
		clone.tbjiMember=this.tbjiMember;
		
			
		clone.tbjiDistributor=this.tbjiDistributor;
		
			
		clone.tbjiType=this.tbjiType;
		
			
		clone.tbjiOrderDetails=this.tbjiOrderDetails;
		
			
		clone.tbjiMoney=this.tbjiMoney;
		
			
		clone.tbjiTime=this.tbjiTime;
		
		return clone;
	}
	
	
	
	
	
	/**
	 * 根据ID取经销商收益
	 * @param id
	 * @return
	 */
	public static @api TbJxshIncome get(Long id){		
		return getTbJxshIncomeById(id);
	}
	
	
	/**
	 * 设置ID
	 * @param id
	 * @return
	 */
	public void setId(Long id){		
		this.tbjiId = id;
	}
	
	
	/**
	 * 获取所有经销商收益
	 * @return
	 */
	public static @api List<TbJxshIncome> list(Map params,Integer size){
		return getTbJxshIncomeList(params,size);
	}
	/**
	 * 获取经销商收益分页
	 * @return
	 */
	public static @api Page<TbJxshIncome> page(Integer page,Integer size,Map params){
		return getTbJxshIncomePage(page, size , params);
	}
	
	
	/**
	 * 根据查询条件取经销商收益
	 * @param params
	 * @return
	 */
	public static @api TbJxshIncome Get(Map params){
		return getTbJxshIncome(params);
	}
	/**
	 * 获取经销商收益数
	 * @return
	 */
	public static @api Long count(Map params){
		return getTbJxshIncomeCount(params);
	}
	/**
	 * 获取经销商收益数
	 * @return
	 */
	public static @api <T> T eval(String eval,Map params){
		return getTbJxshIncomeEval(eval,params);
	}
	
	
	/**
	 * 获取经销商收益图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> stats(Map params,C sumKey,C groupKey){
		return getTbJxshIncomeStats(params,sumKey,groupKey,-1);
	}
	/**
	 * 获取经销商收益图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 分组的字段
	 * @param dateType 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> stats(Map params,C sumKey,C groupKey,int dateType){
		return getTbJxshIncomeStats(params,sumKey,groupKey,dateType);
	}
	
	
	/**
	 * 根据ID取经销商收益
	 * @param id
	 * @return
	 */
	public static @api TbJxshIncome getTbJxshIncomeById(Long id){		
		return getTbJxshIncomeDao().getTbJxshIncomeById(id);
	}
	
	
	/**
	 * 获取id
	 * @return
	 */
	public Long getId(){
		return this.tbjiId;
	}
	
	
	
	/**
	 * 根据ID取经销商收益的标识键值
	 * @param id
	 * @return
	 */
	public static @api String getKeyValue(Object key){
		Long id = Utils.parseLong(key);	
		if(id==null || id.longValue()==0 ){
			
			return null;
			
		}
		String value = null;
		
		value = Cache.getValue(TbJxshIncome.class, id);
				
		if(value==null){
			TbJxshIncome tbJxshIncome = get(id);
			if(tbJxshIncome!=null){
				String strValue = tbJxshIncome.getTbjiId$();
				
				
				Cache.setValue(TbJxshIncome.class, id ,strValue);
				
				value = strValue;
			}else{
				
				Cache.setValue(TbJxshIncome.class, id ,"{"+id+"}",30);
				
				value = "{"+id+"}";
			}
		}
		
		/************LAZY3Q_ID_KEYVALUE************/
		/************LAZY3Q_ID_KEYVALUE************/
		return value;
	}	
	
	
	/**
	 * 获取当前对象的键值
	 * @return
	 */
	public String getKeyValue(){
		
		/************LAZY3Q_CODE_KEYVALUE************/
		/************LAZY3Q_CODE_KEYVALUE************/
		String keyValue = this.getTbjiId$();
		
		return keyValue;
	}
	
	
	/**
	 * 根据关键字精确查询经销商收益对象
	 * @return
	 */
	public static @api TbJxshIncome find(String key){
		if(Utils.empty(key))return null;
		Map params = new HashMap();
		if(key.toLowerCase().startsWith("id:"))//如果查询条件以id:开头，则按ID查询
			params.put("tbjiId", key.toLowerCase().replaceFirst("id:", ""));					
		else{//按标识查询，精确查询
			String strDefinex = "";
			
			strDefinex="(2=1 "+strDefinex+")";
			params.put("definex",strDefinex);
		}
		
		/************LAZY3Q_CODE_FIND************/
		/************LAZY3Q_CODE_FIND************/
		return TbJxshIncome.getTbJxshIncome(params);
	}
	
	
	/**
	 * 根据关键字查询经销商收益
	 * @return
	 */
	public static @api List<Map> query(String key,int size,Map params,Boolean bObject){
		if(Utils.empty((String)params.get("asc")) && Utils.empty((String)params.get("desc")))//如果未传入排序字段
			params.put("desc","tbji_id");//那么，默认以主键降序，传给Dao层
		String strTerm=key;		
		if(!Utils.empty(strTerm)){
			if(strTerm.toLowerCase().startsWith("id:"))//如果查询条件以id:开头，则按ID查询
				params.put("tbjiId", strTerm.toLowerCase().replaceFirst("id:", ""));					
			else//按标识查询，模糊查询请带%
			{
				String strDefinex = "";
				
				strDefinex="(2=1 "+strDefinex+")";
				params.put("definex",strDefinex);
			}
		}
		
		
		/************LAZY3Q_CODE_QUERY************/
		/************LAZY3Q_CODE_QUERY************/
			
		List<TbJxshIncome> list = page(0,size,params).getResult();
		
		/**
		* OK!取到数据拼成放入Map中，[{value,text,object:{...}},...]
		* value:数据ID，text:数据标识,object,整个对象
		**/
		List<Map> result = new java.util.ArrayList();
		for(TbJxshIncome tbJxshIncome:list){
			Map map = new HashMap();
			map.put("key",tbJxshIncome.getTbjiId().toString());
			map.put("value", Utils.js(tbJxshIncome.getKeyValue()));
			if(bObject==true)
				map.put("object",tbJxshIncome);
			result.add(map);
		}
		
		
		/************LAZY3Q_AFTER_QUERY************/
		/************LAZY3Q_AFTER_QUERY************/
		
		return result;
	}
	
	
	
	/**
	 * 获取所有经销商收益
	 * @return
	 */
	public static @api List<TbJxshIncome> getTbJxshIncomeList(Map params,Integer size){
		return getTbJxshIncomeDao().getTbJxshIncomeList(params,0,size);
	}
	
	/**
	 * 获取经销商收益分页
	 * @return
	 */
	public static @api Page<TbJxshIncome> getTbJxshIncomePage(Integer page,Integer size,Map params){
		if(page==null)page=0;
		if(size==null)size=20;
		return getTbJxshIncomeDao().getTbJxshIncomePage(page, size , params);
	}
	
	/**
	 * 根据查询条件取经销商收益
	 * @param params
	 * @return
	 */
	public static @api TbJxshIncome getTbJxshIncome(Map params){
		return getTbJxshIncomeDao().getTbJxshIncome(params);
	}
	
	/**
	 * 保存一个经销商收益
	 * @param tbJxshIncome
	 * @return
	 */
	public static @api TbJxshIncome saveTbJxshIncome(TbJxshIncome tbJxshIncome){
		return getTbJxshIncomeDao().saveTbJxshIncome(tbJxshIncome);
	}
	
	/**
	 * 根据条件更新经销商收益
	 * @param values
	 * @param params
	 */
	public static @api int updateTbJxshIncomeByConfirm(Map values, Map params){
		return getTbJxshIncomeDao().updateTbJxshIncomeByConfirm(values,params);
	}
	
	/**
	 * 修改一个经销商收益
	 * @param tbJxshIncome
	 * @return
	 */
	public static @api int updateTbJxshIncome(TbJxshIncome tbJxshIncome){
		return getTbJxshIncomeDao().updateTbJxshIncome(tbJxshIncome);
	}
	
	/**
	 * 更新经销商收益非空字段
	 * @param tbJxshIncome
	 */
	public static @api int updateTbJxshIncome$NotNull(TbJxshIncome tbJxshIncome){
		return getTbJxshIncomeDao().updateTbJxshIncome$NotNull(tbJxshIncome);
	}
	
	/**
	 * 获取经销商收益数
	 * @return
	 */
	public static @api Long getTbJxshIncomeCount(Map params){
		return getTbJxshIncomeDao().getTbJxshIncomeCount(params);
	}
		
		
	/**
	 * 获取经销商收益自定义求和表达式,比如求和:eval="sum(id)"
	 * @return
	 */	
	public static @api <T> T getTbJxshIncomeEval(String eval,Map params){
		return getTbJxshIncomeDao().getTbJxshIncomeEval(eval,params);
	}
	
	
	/**
	 * 获取经销商收益图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 分组的字段
	 * @param dateType 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> getTbJxshIncomeStats(Map params,C sumKey,C groupKey,int dateType){
		//TODO:图表统计功能未实现
		
		Map<String,Object> groups=new HashMap();//要分组的字段
		Map<String,Object> sums=new HashMap();//要统计的字段
		
		String[][] dateFormats=new String[][]{
				null,
				new String[]{"%Y","yyyy年","Y"},
				new String[]{"%Y-%m","yyyy年MM月","M"},
				new String[]{"%Y%U","yyyy年第ww周","W"},
				new String[]{"%Y-%m-%d","yyyy年MM月dd日","D"},
				new String[]{"%Y-%m-%d %H","yyyy年MM月dd日 HH点","H"},
				new String[]{"%m","MM月"},
				new String[]{"%d","dd号"},
				new String[]{"%H","HH点"} 
		};
		
		//获取要分组的字段，放入Map中
		if(dateType>0){
			groups.put(groupKey.toString(),"DATE_FORMAT({key},'"+dateFormats[dateType][0]+"')");
		}else{
			groups.put(groupKey.toString(),"{key}");
		}
		if(dateType<6 && dateType>0){ 
			params.put("asc", groupKey.toString()); 
			if(params.get(groupKey.name()+"Start")==null){
				params.put(groupKey.name()+"Start", Utils.date(new Date(), -24, dateFormats[dateType][2]));
			}
		}
		
		
		//获取要统计的字段，放入Map中
		if(sumKey.toString().equals("count")){
			sums.put(sumKey.toString(),"count(*)");
		}else{
			sums.put(sumKey.toString(),"sum({key})");
		}
		
		List<Map> list = getTbJxshIncomeDao().getTbJxshIncomeStats(params,groups,sums);
		
		List<Map> result = new ArrayList();
		for(Map m:list){
			Map map = new HashMap();
			Object value = m.get(sumKey.toString());
			Object name = null;
			Object groupValue = m.get(groupKey.toString());
			if(dateType>0){
				name = Utils.date(Utils.parseDate(groupValue), dateFormats[dateType][1]);
			}else{
				try{
					java.lang.reflect.Method method = TbJxshIncome.class.getMethod("get"+Utils.ForMat(groupKey.toString())+"$");
					method.setAccessible(true);
					name = method.invoke(TbJxshIncome.fromMap(m));
				}catch(Exception ex){
					ex.printStackTrace();
				}
			}
			map.put("name", name);
			map.put("value", value);
			result.add(map);
		}
		return result;
	}
	
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static int updateTbJxshIncome(Map set,Map where){
		if(set.isEmpty())throw new RuntimeException("set为空");
		if(where.isEmpty())throw new RuntimeException("where为空");
		where.put("confirm", "1");
		return getTbJxshIncomeDao().updateTbJxshIncomeByConfirm(set, where);
	}
	
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static void deleteTbJxshIncome(Map where){
		if(where.isEmpty())throw new RuntimeException("where为空");
		where.put("confirm", "1");
		getTbJxshIncomeDao().deleteTbJxshIncomeByConfirm(where);
	}
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static void delete(Long id){
		if(id==null)throw new RuntimeException("id为空");
		
		getTbJxshIncomeDao().deleteTbJxshIncomeById(id);
		
	}
	
	
	/**
	 * 保存经销商收益对象
	 * @param params
	 * @return
	 */
	public TbJxshIncome save(){
		if(this.getTbjiId()!=null)
			getTbJxshIncomeDao().updateTbJxshIncome(this);
		else
			return getTbJxshIncomeDao().saveTbJxshIncome(this);
		return this;
	}
	
	
	/**
	 * 更新经销商收益对象的非空字段,注意跟Service里面的update不一样哦
	 * @param params
	 * @return
	 */
	public int update(){
		return getTbJxshIncomeDao().updateTbJxshIncome$NotNull(this);
	}
	
	
	/**
	 * 删除
	 * @param params
	 * @return
	 */
	public void delete(){
		
			getTbJxshIncomeDao().deleteTbJxshIncomeById(this.getTbjiId());
	}
	
	/**
	 * 执行事务
	 * @param function
	 */
	public static <T> T execute(Function function){
		return getTbJxshIncomeDao().executeTransaction(function);
	}

	
	
	/*******************************编号**********************************/	
	/**
	* 编号 [非空]      
	**/
	public Long getTbjiId(){
		
		if(this.tbjiId!=null){
			return this.tbjiId;
		}
		
		return this.tbjiId;
	}
	/**
	* 获取编号格式化(toString)
	**/
	public String getTbjiId$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbjiId());
	 
	 	 return strValue;
	}
	/**
	* 根据编号反格式化
	**/
	public void setTbjiId$(String strValue){
		if(Utils.empty(strValue)){
			this.tbjiId=null;
			return;
		}
	
	
	 	this.tbjiId=Utils.parseLong(strValue);
	 
	}
	
	/**
	* 编号 [非空]      
	**/
	public void setTbjiId(Long tbjiId){
		this.tbjiId = tbjiId;
		
		this.setSeted(F.tbjiId);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************所属品牌**********************************/	
	/**
	* 所属品牌 [非空] [Merchant]     
	**/
	public Long getTbjiMerchant(){
		
		if(this.tbjiMerchant!=null){
			return this.tbjiMerchant;
		}
		
		return this.tbjiMerchant;
	}
	/**
	* 获取所属品牌格式化(toString)
	**/
	public String getTbjiMerchant$(){
		String strValue="";
	
	
		 
		if(this.getTbjiMerchant()!=null){
			
				strValue+=Utils.string(Merchant.getKeyValue(this.getTbjiMerchant()));
			
		}			
		 
	 
	 	 return strValue;
	}
	/**
	* 根据所属品牌反格式化
	**/
	public void setTbjiMerchant$(String strValue){
		if(Utils.empty(strValue)){
			this.tbjiMerchant=null;
			return;
		}
	
	
		 
		Merchant item = Merchant.find(strValue);
		if(item!=null){
			
			this.tbjiMerchant = Utils.parseLong(item.getId());
			
		}
		 
	 
	}
	
	/**
	* 所属品牌 [非空] [Merchant]     
	**/
	public void setTbjiMerchant(Long tbjiMerchant){
		this.tbjiMerchant = tbjiMerchant;
		
		this.setSeted(F.tbjiMerchant);
		
	}
	
	
		 
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 		
	/**
	* 获取关联对象[品牌信息]
	**/	 			
 	public Merchant get$tbjiMerchant(){
 		if(this.$tbjiMerchant!=null)
 			return this.$tbjiMerchant;
 		com.distribute.framework.model.Merchant merchant = null;
		if(this.getTbjiMerchant()!=null){
		
 			merchant = Merchant.get(this.getTbjiMerchant());
 		
 		}
 		return merchant;
	}
	
 	
	
	
	/*******************************经销商**********************************/	
	/**
	* 经销商 [非空] [TbJxsh]     
	**/
	public Long getTbjiJxsh(){
		
		if(this.tbjiJxsh!=null){
			return this.tbjiJxsh;
		}
		
		return this.tbjiJxsh;
	}
	/**
	* 获取经销商格式化(toString)
	**/
	public String getTbjiJxsh$(){
		String strValue="";
	
	
		 
		if(this.getTbjiJxsh()!=null){
			
				strValue+=Utils.string(TbJxsh.getKeyValue(this.getTbjiJxsh()));
			
		}			
		 
	 
	 	 return strValue;
	}
	/**
	* 根据经销商反格式化
	**/
	public void setTbjiJxsh$(String strValue){
		if(Utils.empty(strValue)){
			this.tbjiJxsh=null;
			return;
		}
	
	
		 
		TbJxsh item = TbJxsh.find(strValue);
		if(item!=null){
			
			this.tbjiJxsh = Utils.parseLong(item.getTbjId());
			
		}
		 
	 
	}
	
	/**
	* 经销商 [非空] [TbJxsh]     
	**/
	public void setTbjiJxsh(Long tbjiJxsh){
		this.tbjiJxsh = tbjiJxsh;
		
		this.setSeted(F.tbjiJxsh);
		
	}
	
	
		 
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 		
	/**
	* 获取关联对象[经销商]
	**/	 			
 	public TbJxsh get$tbjiJxsh(){
 		if(this.$tbjiJxsh!=null)
 			return this.$tbjiJxsh;
 		com.distribute.framework.model.TbJxsh tbJxsh = null;
		if(this.getTbjiJxsh()!=null){
		
 			tbJxsh = TbJxsh.get(this.getTbjiJxsh());
 		
 		}
 		return tbJxsh;
	}
	
 	
	
	
	/*******************************经销商名称**********************************/	
	/**
	* 经销商名称       
	**/
	public String getTbjiJxsName(){
		
		if(this.tbjiJxsName!=null){
			return this.tbjiJxsName;
		}
		
		return this.tbjiJxsName;
	}
	/**
	* 获取经销商名称格式化(toString)
	**/
	public String getTbjiJxsName$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbjiJxsName());
	 
	 	 return strValue;
	}
	/**
	* 根据经销商名称反格式化
	**/
	public void setTbjiJxsName$(String strValue){
		if(Utils.empty(strValue)){
			this.tbjiJxsName=null;
			return;
		}
	
	
	 	this.tbjiJxsName=strValue;
	 
	}
	
	/**
	* 经销商名称       
	**/
	public void setTbjiJxsName(String tbjiJxsName){
		this.tbjiJxsName = tbjiJxsName;
		
		this.setSeted(F.tbjiJxsName);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************订单编号**********************************/	
	/**
	* 订单编号 [非空]      
	**/
	public Long getTbjiOrderId(){
		
		if(this.tbjiOrderId!=null){
			return this.tbjiOrderId;
		}
		
		return this.tbjiOrderId;
	}
	/**
	* 获取订单编号格式化(toString)
	**/
	public String getTbjiOrderId$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbjiOrderId());
	 
	 	 return strValue;
	}
	/**
	* 根据订单编号反格式化
	**/
	public void setTbjiOrderId$(String strValue){
		if(Utils.empty(strValue)){
			this.tbjiOrderId=null;
			return;
		}
	
	
	 	this.tbjiOrderId=Utils.parseLong(strValue);
	 
	}
	
	/**
	* 订单编号 [非空]      
	**/
	public void setTbjiOrderId(Long tbjiOrderId){
		this.tbjiOrderId = tbjiOrderId;
		
		this.setSeted(F.tbjiOrderId);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************订单时间**********************************/	
	/**
	* 订单时间       
	**/
	public Date getTbjiOrderTime(){
		
		if(this.tbjiOrderTime!=null){
			return this.tbjiOrderTime;
		}
		
		return this.tbjiOrderTime;
	}
	/**
	* 获取订单时间格式化(toString)
	**/
	public String getTbjiOrderTime$(){
		String strValue="";
	
	
	 	
		 strValue=Utils.string(Utils.date(this.getTbjiOrderTime(),"yyyy-MM-dd HH:mm:ss"));
		
	 
	 	 return strValue;
	}
	/**
	* 根据订单时间反格式化
	**/
	public void setTbjiOrderTime$(String strValue){
		if(Utils.empty(strValue)){
			this.tbjiOrderTime=null;
			return;
		}
	
	
	 	this.tbjiOrderTime=Utils.date(strValue,"yyyy-MM-dd HH:mm:ss");
	 
	}
	
	/**
	* 订单时间       
	**/
	public void setTbjiOrderTime(Date tbjiOrderTime){
		this.tbjiOrderTime = tbjiOrderTime;
		
		this.setSeted(F.tbjiOrderTime);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************下单人**********************************/	
	/**
	* 下单人       
	**/
	public String getTbjiMember(){
		
		if(this.tbjiMember!=null){
			return this.tbjiMember;
		}
		
		return this.tbjiMember;
	}
	/**
	* 获取下单人格式化(toString)
	**/
	public String getTbjiMember$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbjiMember());
	 
	 	 return strValue;
	}
	/**
	* 根据下单人反格式化
	**/
	public void setTbjiMember$(String strValue){
		if(Utils.empty(strValue)){
			this.tbjiMember=null;
			return;
		}
	
	
	 	this.tbjiMember=strValue;
	 
	}
	
	/**
	* 下单人       
	**/
	public void setTbjiMember(String tbjiMember){
		this.tbjiMember = tbjiMember;
		
		this.setSeted(F.tbjiMember);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************配送商**********************************/	
	/**
	* 配送商       
	**/
	public String getTbjiDistributor(){
		
		if(this.tbjiDistributor!=null){
			return this.tbjiDistributor;
		}
		
		return this.tbjiDistributor;
	}
	/**
	* 获取配送商格式化(toString)
	**/
	public String getTbjiDistributor$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbjiDistributor());
	 
	 	 return strValue;
	}
	/**
	* 根据配送商反格式化
	**/
	public void setTbjiDistributor$(String strValue){
		if(Utils.empty(strValue)){
			this.tbjiDistributor=null;
			return;
		}
	
	
	 	this.tbjiDistributor=strValue;
	 
	}
	
	/**
	* 配送商       
	**/
	public void setTbjiDistributor(String tbjiDistributor){
		this.tbjiDistributor = tbjiDistributor;
		
		this.setSeted(F.tbjiDistributor);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************订单类别**********************************/	
	/**
	* 订单类别    1:直接购买订单 2:余额提货订单    
	**/
	public Short getTbjiType(){
		
		if(this.tbjiType!=null){
			return this.tbjiType;
		}
		
		return this.tbjiType;
	}
	/**
	* 获取订单类别格式化(toString)
	**/
	public String getTbjiType$(){
		String strValue="";
	
	
		
			
		 if(Utils.equals(Utils.string(this.getTbjiType()),"1"))
			strValue=Utils.string("直接购买订单");		 
			
		 if(Utils.equals(Utils.string(this.getTbjiType()),"2"))
			strValue=Utils.string("余额提货订单");		 
			
		
	 
	 	 return strValue;
	}
	/**
	* 根据订单类别反格式化
	**/
	public void setTbjiType$(String strValue){
		if(Utils.empty(strValue)){
			this.tbjiType=null;
			return;
		}
	
	
		
			
		 if(Utils.equals(strValue,"直接购买订单"))
		 	this.tbjiType=Utils.parseShort("1");
			
		 if(Utils.equals(strValue,"余额提货订单"))
		 	this.tbjiType=Utils.parseShort("2");
			
		
	 
	}
	
	/**
	* 订单类别    1:直接购买订单 2:余额提货订单    
	**/
	public void setTbjiType(Short tbjiType){
		this.tbjiType = tbjiType;
		
		this.setSeted(F.tbjiType);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************订单明细**********************************/	
	/**
	* 订单明细    query:goodsNumber text:name menoy:price number:number select:status    
	**/
	public String getTbjiOrderDetails(){
		
		if(this.tbjiOrderDetails!=null){
			return this.tbjiOrderDetails;
		}
		
		return this.tbjiOrderDetails;
	}
	/**
	* 获取订单明细格式化(toString)
	**/
	public String getTbjiOrderDetails$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getTbjiOrderDetails());
	 
	 	 return strValue;
	}
	/**
	* 根据订单明细反格式化
	**/
	public void setTbjiOrderDetails$(String strValue){
		if(Utils.empty(strValue)){
			this.tbjiOrderDetails=null;
			return;
		}
	
	
		this.tbjiOrderDetails=Utils.parseString(strValue);
	 
	}
	
	/**
	* 订单明细    query:goodsNumber text:name menoy:price number:number select:status    
	**/
	public void setTbjiOrderDetails(String tbjiOrderDetails){
		this.tbjiOrderDetails = tbjiOrderDetails;
		
		this.setSeted(F.tbjiOrderDetails);
		
	}
	
	
	
	
	/**
	* 订单明细对应内部类
	**/
	public static class TbjiOrderDetails implements java.io.Serializable{
		
		Long goodsNumber;//商品编号  
		
		String name;//商品名称  
		
		Double price;//商品价格  
		
		Integer number;//数量  
		
		Short status;//状态  [{"text":"正常","value":"1"},{"text":"无效","value":"0"}]
		
		
		/** 商品编号   **/
		public void setGoodsNumber(Long goodsNumber){
			this.goodsNumber=goodsNumber;
		}
		/** 商品编号   **/
		public Long getGoodsNumber(){
			return this.goodsNumber;
		}
		
		/** 商品名称   **/
		public void setName(String name){
			this.name=name;
		}
		/** 商品名称   **/
		public String getName(){
			return this.name;
		}
		
		/** 商品价格   **/
		public void setPrice(Double price){
			this.price=price;
		}
		/** 商品价格   **/
		public Double getPrice(){
			return this.price;
		}
		
		/** 数量   **/
		public void setNumber(Integer number){
			this.number=number;
		}
		/** 数量   **/
		public Integer getNumber(){
			return this.number;
		}
		
		/** 状态  [{"text":"正常","value":"1"},{"text":"无效","value":"0"}] **/
		public void setStatus(Short status){
			this.status=status;
		}
		/** 状态  [{"text":"正常","value":"1"},{"text":"无效","value":"0"}] **/
		public Short getStatus(){
			return this.status;
		}
		
	}
	
	
	
	
	
	/**
	* 获取订单明细格式化列表
	**/ 			
 	public List<TbjiOrderDetails> get$tbjiOrderDetails(){
 		List<TbjiOrderDetails> array = new ArrayList();
 		String strJson = this.tbjiOrderDetails;
 		if(this.getSeted("tbjiOrderDetails")==null || !this.getSeted("tbjiOrderDetails")){
 			TbJxshIncome dbTbJxshIncome = TbJxshIncome.get(this.tbjiId);
 			if(dbTbJxshIncome!=null)
 				strJson = dbTbJxshIncome.getTbjiOrderDetails();
 		} 
 		List<Map> list = (List<Map>) (Utils.empty(strJson) ? null : Utils.eval(strJson));
 		if(list!=null){
	 		for(Map map:list){
	 			TbjiOrderDetails tbjiOrderDetails = new TbjiOrderDetails();
	 			
	 			tbjiOrderDetails.setGoodsNumber(Utils.parseLong(map.get("goodsNumber")));
	 			
	 			tbjiOrderDetails.setName(Utils.parseString(map.get("name")));
	 			
	 			tbjiOrderDetails.setPrice(Utils.parseDouble(map.get("price")));
	 			
	 			tbjiOrderDetails.setNumber(Utils.parseInteger(map.get("number")));
	 			
	 			tbjiOrderDetails.setStatus(Utils.parseShort(map.get("status")));
	 			
	 			array.add(tbjiOrderDetails);
	 		}
 		}else{
 			list = new ArrayList();
 		}
 		return array;
 	}
 	public void addTbjiOrderDetails(Long goodsNumber,String name,Double price,Integer number,Short status){
 		TbjiOrderDetails tbjiOrderDetails = new TbjiOrderDetails();
 		
 		tbjiOrderDetails.setGoodsNumber(goodsNumber);
		
 		tbjiOrderDetails.setName(name);
		
 		tbjiOrderDetails.setPrice(price);
		
 		tbjiOrderDetails.setNumber(number);
		
 		tbjiOrderDetails.setStatus(status);
		
		this.addTbjiOrderDetails(tbjiOrderDetails);
 	}
 	public void addTbjiOrderDetails(TbjiOrderDetails tbjiOrderDetails){
 		List<TbjiOrderDetails> array = get$tbjiOrderDetails();
 		array.add(tbjiOrderDetails);
 		this.tbjiOrderDetails = Utils.json(array);
 	}
 	
 	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************收益金额**********************************/	
	/**
	* 收益金额 [非空]      
	**/
	public Double getTbjiMoney(){
		
		if(this.tbjiMoney!=null){
			return this.tbjiMoney;
		}
		
		return this.tbjiMoney;
	}
	/**
	* 获取收益金额格式化(toString)
	**/
	public String getTbjiMoney$(){
		String strValue="";
	
	
			
		 strValue=Utils.string(this.getTbjiMoney());	
			
	 
	 	 return strValue;
	}
	/**
	* 根据收益金额反格式化
	**/
	public void setTbjiMoney$(String strValue){
		if(Utils.empty(strValue)){
			this.tbjiMoney=null;
			return;
		}
	
	
	 	this.tbjiMoney=Utils.parseDouble(strValue);
	 
	}
	
	/**
	* 收益金额 [非空]      
	**/
	public void setTbjiMoney(Double tbjiMoney){
		this.tbjiMoney = tbjiMoney;
		
		this.setSeted(F.tbjiMoney);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************获得时间**********************************/	
	/**
	* 获得时间 [非空]      
	**/
	public Date getTbjiTime(){
		
		if(this.tbjiTime!=null){
			return this.tbjiTime;
		}
		
		return this.tbjiTime;
	}
	/**
	* 获取获得时间格式化(toString)
	**/
	public String getTbjiTime$(){
		String strValue="";
	
	
	 	
		 strValue=Utils.string(Utils.date(this.getTbjiTime(),"yyyy-MM-dd HH:mm:ss"));
		
	 
	 	 return strValue;
	}
	/**
	* 根据获得时间反格式化
	**/
	public void setTbjiTime$(String strValue){
		if(Utils.empty(strValue)){
			this.tbjiTime=null;
			return;
		}
	
	
	 	this.tbjiTime=Utils.date(strValue,"yyyy-MM-dd HH:mm:ss");
	 
	}
	
	/**
	* 获得时间 [非空]      
	**/
	public void setTbjiTime(Date tbjiTime){
		this.tbjiTime = tbjiTime;
		
		this.setSeted(F.tbjiTime);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	
	/************LAZY3Q_DEFINE_CODE************/
	/************LAZY3Q_DEFINE_CODE************/	
	
	
	/**
	 * 触发器
	 */
	public static void on(Trigger.Index index,final Notify.Listener listener,Trigger.Type... types){
		Notify.on(TbJxshIncome.class, index, listener, types);
	}
	public static void on(final Notify.Listener listener,String type){
		Notify.on(TbJxshIncome.class, listener, type);
	}
	/**
	 * 当修改字段时
	 * @param filedName
	 * @param listener
	 */
	public static void on(String filedName,final Notify.Listener listener){
		Notify.on(TbJxshIncome.class, listener, filedName);
	}
	/**
	 * 当修改字段为某值时
	 * @param filedName
	 * @param value
	 * @param listener
	 */
	public static void on(String filedName,Object value,final Notify.Listener listener){
		if(value==null)return;
		Notify.on(TbJxshIncome.class, listener, filedName+"."+Utils.md5(""+value));
	}
	public void notify(String type){
		Trigger.on(TbJxshIncome.class,type, this);
	}
	
	
	/**
	 * 用来获取当有字段关联对象时的获取方式,调用如${TbJxshIncome.obj.filedName}
	 * 因为有些变态的模板语言不能识别$，所以不能以${TbJxshIncome.$filedName}获取关联对象
	 */
	public Map getObj(){
		return new HashMap(){
			@Override
			public Object get(Object key) {
				try {
					return TbJxshIncome.class.getMethod("get$"+Utils.forMat(key.toString())).invoke(TbJxshIncome.this);
				} catch (Exception e) {
					e.printStackTrace();
				}
				return null;
			}
		};
	}
	/**
	 * 用来获取某字段格式化的获取方式,调用如${TbJxshIncome.fmt.filedName}
	 * 因为有些变态的模板语言不能识别$，所以不能以${TbJxshIncome.filedName$}获取某字段格式化
	 */
	public Map getFmt(){
		return new HashMap(){
			@Override
			public Object get(Object key) {
				try {
					return TbJxshIncome.class.getMethod("get"+Utils.ForMat(key.toString()+"$")).invoke(TbJxshIncome.this);
				} catch (Exception e) {
					e.printStackTrace();
				}
				return null;
			}
		};
	}
	/**
	 * 获取查询参数链式串
	 * @return
	 */
	public static @Deprecated M where(){ return new M(0); }
	public static @Deprecated M m(){ return new M(0); }
	public static M where = new M(0,true);
	public static @database(DatabaseNames.distribute_sys) class M extends IbatisMap{
		int type = 0; 
		M linked = null;
		Boolean proxy = false;
		public M set = null;
		public M(int type){
			this.type = type;
			if(this.type==0){
				set = new M(1,true);
				set.linked = this;
			}
		};
		public M(int type,Boolean proxy){
			this.type = type;
			this.proxy=proxy;
		};
		public M proxy(){
			M m = new M(this.type);//当前的对像
			if(this.type==0){
				m.set = new M(1,true);//set对象
				m.set.linked = m;
			}else{
				m.linked=this.linked;
				this.linked.linked=m;
			}
			return m;
		}
		public @Deprecated M set(){			
			M m = this;
			m.linked=new M(1);
			m.linked.linked=m;
			return m.linked;
		};
		
		public M on(IbatisMap value,C column,String joinColumn){if(proxy)return proxy().on(value,column,joinColumn);this.put(value.getClass().getDeclaringClass().getSimpleName(), value);value.put("on", column.toString());value.put("to", joinColumn);return this;};
		
		
			
		
		/** 编号 [非空]       **/
		public M tbjiId(Object tbjiId){if(proxy)return proxy().tbjiId(tbjiId);  this.put("tbjiId", tbjiId);return this;};
	 	/** and tbji_id is null */
 		public M tbjiIdNull(){if(proxy)return proxy().tbjiIdNull();if(this.get("tbjiIdNot")==null)this.put("tbjiIdNot", "");this.put("tbjiId", null);return this;};
 		/** not .... */
 		public M tbjiIdNot(){if(proxy)return proxy().tbjiIdNot();this.put("tbjiIdNot", "not");return this;};
 		public M tbjiIdNotNull(){if(proxy)return proxy().tbjiIdNotNull();this.put("tbjiIdNot", "not");this.put("tbjiId", null);return this;};
 		public M tbjiIdNot(Object tbjiId){if(proxy)return proxy().tbjiIdNot(tbjiId);this.put("tbjiIdNot", "not");this.put("tbjiId", tbjiId);return this;};
	 		
		/** and tbji_id <= ? */
		public M tbjiIdMin(Object min){if(proxy)return proxy().tbjiIdMin(min);this.put("tbjiIdMin", min);return this;};
		/** and tbji_id >= ? */
		public M tbjiIdMax(Object max){if(proxy)return proxy().tbjiIdMax(max);this.put("tbjiIdMax", max);return this;};
			
			
		public M tbjiIdIn(String ids){
			if(proxy)return proxy().tbjiIdIn(ids);  this.put("tbjiIdIn", ids);return this;
		};	
 			
		
			
	 	
			
		public M tbjiMerchant$on(Merchant.M value){if(proxy)return proxy().tbjiMerchant$on(value);this.put("TbjiMerchant", value);value.put("on", "tbji_merchant");return this;};
 				
 			
		
		/** 所属品牌 [非空] [Merchant]      **/
		public M tbjiMerchant(Object tbjiMerchant){if(proxy)return proxy().tbjiMerchant(tbjiMerchant);  this.put("tbjiMerchant", tbjiMerchant);return this;};
	 	/** and tbji_merchant is null */
 		public M tbjiMerchantNull(){if(proxy)return proxy().tbjiMerchantNull();if(this.get("tbjiMerchantNot")==null)this.put("tbjiMerchantNot", "");this.put("tbjiMerchant", null);return this;};
 		/** not .... */
 		public M tbjiMerchantNot(){if(proxy)return proxy().tbjiMerchantNot();this.put("tbjiMerchantNot", "not");return this;};
 		public M tbjiMerchantNotNull(){if(proxy)return proxy().tbjiMerchantNotNull();this.put("tbjiMerchantNot", "not");this.put("tbjiMerchant", null);return this;};
 		public M tbjiMerchantNot(Object tbjiMerchant){if(proxy)return proxy().tbjiMerchantNot(tbjiMerchant);this.put("tbjiMerchantNot", "not");this.put("tbjiMerchant", tbjiMerchant);return this;};
	 		
			
		public M tbjiMerchantIn(String ids){
			if(proxy)return proxy().tbjiMerchantIn(ids);  this.put("tbjiMerchantIn", ids);return this;
		};	
 			
		
			
	 	
			
		public M tbjiJxsh$on(TbJxsh.M value){if(proxy)return proxy().tbjiJxsh$on(value);this.put("TbjiJxsh", value);value.put("on", "tbji_jxsh");return this;};
 				
 			
		
		/** 经销商 [非空] [TbJxsh]      **/
		public M tbjiJxsh(Object tbjiJxsh){if(proxy)return proxy().tbjiJxsh(tbjiJxsh);  this.put("tbjiJxsh", tbjiJxsh);return this;};
	 	/** and tbji_jxsh is null */
 		public M tbjiJxshNull(){if(proxy)return proxy().tbjiJxshNull();if(this.get("tbjiJxshNot")==null)this.put("tbjiJxshNot", "");this.put("tbjiJxsh", null);return this;};
 		/** not .... */
 		public M tbjiJxshNot(){if(proxy)return proxy().tbjiJxshNot();this.put("tbjiJxshNot", "not");return this;};
 		public M tbjiJxshNotNull(){if(proxy)return proxy().tbjiJxshNotNull();this.put("tbjiJxshNot", "not");this.put("tbjiJxsh", null);return this;};
 		public M tbjiJxshNot(Object tbjiJxsh){if(proxy)return proxy().tbjiJxshNot(tbjiJxsh);this.put("tbjiJxshNot", "not");this.put("tbjiJxsh", tbjiJxsh);return this;};
	 		
			
		public M tbjiJxshIn(String ids){
			if(proxy)return proxy().tbjiJxshIn(ids);  this.put("tbjiJxshIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 经销商名称        **/
		public M tbjiJxsName(Object tbjiJxsName){if(proxy)return proxy().tbjiJxsName(tbjiJxsName);  this.put("tbjiJxsName", tbjiJxsName);return this;};
	 	/** and tbji_jxs_name is null */
 		public M tbjiJxsNameNull(){if(proxy)return proxy().tbjiJxsNameNull();if(this.get("tbjiJxsNameNot")==null)this.put("tbjiJxsNameNot", "");this.put("tbjiJxsName", null);return this;};
 		/** not .... */
 		public M tbjiJxsNameNot(){if(proxy)return proxy().tbjiJxsNameNot();this.put("tbjiJxsNameNot", "not");return this;};
 		public M tbjiJxsNameNotNull(){if(proxy)return proxy().tbjiJxsNameNotNull();this.put("tbjiJxsNameNot", "not");this.put("tbjiJxsName", null);return this;};
 		public M tbjiJxsNameNot(Object tbjiJxsName){if(proxy)return proxy().tbjiJxsNameNot(tbjiJxsName);this.put("tbjiJxsNameNot", "not");this.put("tbjiJxsName", tbjiJxsName);return this;};
	 		
			
		
			
	 	
			
		
		/** 订单编号 [非空]       **/
		public M tbjiOrderId(Object tbjiOrderId){if(proxy)return proxy().tbjiOrderId(tbjiOrderId);  this.put("tbjiOrderId", tbjiOrderId);return this;};
	 	/** and tbji_order_id is null */
 		public M tbjiOrderIdNull(){if(proxy)return proxy().tbjiOrderIdNull();if(this.get("tbjiOrderIdNot")==null)this.put("tbjiOrderIdNot", "");this.put("tbjiOrderId", null);return this;};
 		/** not .... */
 		public M tbjiOrderIdNot(){if(proxy)return proxy().tbjiOrderIdNot();this.put("tbjiOrderIdNot", "not");return this;};
 		public M tbjiOrderIdNotNull(){if(proxy)return proxy().tbjiOrderIdNotNull();this.put("tbjiOrderIdNot", "not");this.put("tbjiOrderId", null);return this;};
 		public M tbjiOrderIdNot(Object tbjiOrderId){if(proxy)return proxy().tbjiOrderIdNot(tbjiOrderId);this.put("tbjiOrderIdNot", "not");this.put("tbjiOrderId", tbjiOrderId);return this;};
	 		
		/** and tbji_order_id <= ? */
		public M tbjiOrderIdMin(Object min){if(proxy)return proxy().tbjiOrderIdMin(min);this.put("tbjiOrderIdMin", min);return this;};
		/** and tbji_order_id >= ? */
		public M tbjiOrderIdMax(Object max){if(proxy)return proxy().tbjiOrderIdMax(max);this.put("tbjiOrderIdMax", max);return this;};
			
			
		public M tbjiOrderIdIn(String ids){
			if(proxy)return proxy().tbjiOrderIdIn(ids);  this.put("tbjiOrderIdIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 订单时间        **/
		public M tbjiOrderTime(Object tbjiOrderTime){if(proxy)return proxy().tbjiOrderTime(tbjiOrderTime);  this.put("tbjiOrderTime", tbjiOrderTime);return this;};
	 	/** and tbji_order_time is null */
 		public M tbjiOrderTimeNull(){if(proxy)return proxy().tbjiOrderTimeNull();if(this.get("tbjiOrderTimeNot")==null)this.put("tbjiOrderTimeNot", "");this.put("tbjiOrderTime", null);return this;};
 		/** not .... */
 		public M tbjiOrderTimeNot(){if(proxy)return proxy().tbjiOrderTimeNot();this.put("tbjiOrderTimeNot", "not");return this;};
 		public M tbjiOrderTimeNotNull(){if(proxy)return proxy().tbjiOrderTimeNotNull();this.put("tbjiOrderTimeNot", "not");this.put("tbjiOrderTime", null);return this;};
 		public M tbjiOrderTimeNot(Object tbjiOrderTime){if(proxy)return proxy().tbjiOrderTimeNot(tbjiOrderTime);this.put("tbjiOrderTimeNot", "not");this.put("tbjiOrderTime", tbjiOrderTime);return this;};
	 		
 		/** and tbji_order_time >= ? */
 		public M tbjiOrderTimeStart(Object start){if(proxy)return proxy().tbjiOrderTimeStart(start);this.put("tbjiOrderTimeStart", start);return this;};			
 		/** and tbji_order_time <= ? */
 		public M tbjiOrderTimeEnd(Object end){if(proxy)return proxy().tbjiOrderTimeEnd(end);this.put("tbjiOrderTimeEnd", end);return this;};
			
			
		
			
	 	
			
		
		/** 下单人        **/
		public M tbjiMember(Object tbjiMember){if(proxy)return proxy().tbjiMember(tbjiMember);  this.put("tbjiMember", tbjiMember);return this;};
	 	/** and tbji_member is null */
 		public M tbjiMemberNull(){if(proxy)return proxy().tbjiMemberNull();if(this.get("tbjiMemberNot")==null)this.put("tbjiMemberNot", "");this.put("tbjiMember", null);return this;};
 		/** not .... */
 		public M tbjiMemberNot(){if(proxy)return proxy().tbjiMemberNot();this.put("tbjiMemberNot", "not");return this;};
 		public M tbjiMemberNotNull(){if(proxy)return proxy().tbjiMemberNotNull();this.put("tbjiMemberNot", "not");this.put("tbjiMember", null);return this;};
 		public M tbjiMemberNot(Object tbjiMember){if(proxy)return proxy().tbjiMemberNot(tbjiMember);this.put("tbjiMemberNot", "not");this.put("tbjiMember", tbjiMember);return this;};
	 		
			
		
			
	 	
			
		
		/** 配送商        **/
		public M tbjiDistributor(Object tbjiDistributor){if(proxy)return proxy().tbjiDistributor(tbjiDistributor);  this.put("tbjiDistributor", tbjiDistributor);return this;};
	 	/** and tbji_distributor is null */
 		public M tbjiDistributorNull(){if(proxy)return proxy().tbjiDistributorNull();if(this.get("tbjiDistributorNot")==null)this.put("tbjiDistributorNot", "");this.put("tbjiDistributor", null);return this;};
 		/** not .... */
 		public M tbjiDistributorNot(){if(proxy)return proxy().tbjiDistributorNot();this.put("tbjiDistributorNot", "not");return this;};
 		public M tbjiDistributorNotNull(){if(proxy)return proxy().tbjiDistributorNotNull();this.put("tbjiDistributorNot", "not");this.put("tbjiDistributor", null);return this;};
 		public M tbjiDistributorNot(Object tbjiDistributor){if(proxy)return proxy().tbjiDistributorNot(tbjiDistributor);this.put("tbjiDistributorNot", "not");this.put("tbjiDistributor", tbjiDistributor);return this;};
	 		
			
		
			
	 	
			
		
		/** 订单类别    1:直接购买订单 2:余额提货订单     **/
		public M tbjiType(Object tbjiType){if(proxy)return proxy().tbjiType(tbjiType);  this.put("tbjiType", tbjiType);return this;};
	 	/** and tbji_type is null */
 		public M tbjiTypeNull(){if(proxy)return proxy().tbjiTypeNull();if(this.get("tbjiTypeNot")==null)this.put("tbjiTypeNot", "");this.put("tbjiType", null);return this;};
 		/** not .... */
 		public M tbjiTypeNot(){if(proxy)return proxy().tbjiTypeNot();this.put("tbjiTypeNot", "not");return this;};
 		public M tbjiTypeNotNull(){if(proxy)return proxy().tbjiTypeNotNull();this.put("tbjiTypeNot", "not");this.put("tbjiType", null);return this;};
 		public M tbjiTypeNot(Object tbjiType){if(proxy)return proxy().tbjiTypeNot(tbjiType);this.put("tbjiTypeNot", "not");this.put("tbjiType", tbjiType);return this;};
	 		
			
		public M tbjiTypeIn(String ids){
			if(proxy)return proxy().tbjiTypeIn(ids);  this.put("tbjiTypeIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 订单明细    query:goodsNumber text:name menoy:price number:number select:status     **/
		public M tbjiOrderDetails(Object tbjiOrderDetails){if(proxy)return proxy().tbjiOrderDetails(tbjiOrderDetails);  this.put("tbjiOrderDetails", tbjiOrderDetails);return this;};
	 	/** and tbji_order_details is null */
 		public M tbjiOrderDetailsNull(){if(proxy)return proxy().tbjiOrderDetailsNull();if(this.get("tbjiOrderDetailsNot")==null)this.put("tbjiOrderDetailsNot", "");this.put("tbjiOrderDetails", null);return this;};
 		/** not .... */
 		public M tbjiOrderDetailsNot(){if(proxy)return proxy().tbjiOrderDetailsNot();this.put("tbjiOrderDetailsNot", "not");return this;};
 		public M tbjiOrderDetailsNotNull(){if(proxy)return proxy().tbjiOrderDetailsNotNull();this.put("tbjiOrderDetailsNot", "not");this.put("tbjiOrderDetails", null);return this;};
 		public M tbjiOrderDetailsNot(Object tbjiOrderDetails){if(proxy)return proxy().tbjiOrderDetailsNot(tbjiOrderDetails);this.put("tbjiOrderDetailsNot", "not");this.put("tbjiOrderDetails", tbjiOrderDetails);return this;};
	 		
			
		
			
	 	
			
		
		/** 收益金额 [非空]       **/
		public M tbjiMoney(Object tbjiMoney){if(proxy)return proxy().tbjiMoney(tbjiMoney);  this.put("tbjiMoney", tbjiMoney);return this;};
	 	/** and tbji_money is null */
 		public M tbjiMoneyNull(){if(proxy)return proxy().tbjiMoneyNull();if(this.get("tbjiMoneyNot")==null)this.put("tbjiMoneyNot", "");this.put("tbjiMoney", null);return this;};
 		/** not .... */
 		public M tbjiMoneyNot(){if(proxy)return proxy().tbjiMoneyNot();this.put("tbjiMoneyNot", "not");return this;};
 		public M tbjiMoneyNotNull(){if(proxy)return proxy().tbjiMoneyNotNull();this.put("tbjiMoneyNot", "not");this.put("tbjiMoney", null);return this;};
 		public M tbjiMoneyNot(Object tbjiMoney){if(proxy)return proxy().tbjiMoneyNot(tbjiMoney);this.put("tbjiMoneyNot", "not");this.put("tbjiMoney", tbjiMoney);return this;};
	 		
		/** and tbji_money <= ? */
		public M tbjiMoneyMin(Object min){if(proxy)return proxy().tbjiMoneyMin(min);this.put("tbjiMoneyMin", min);return this;};
		/** and tbji_money >= ? */
		public M tbjiMoneyMax(Object max){if(proxy)return proxy().tbjiMoneyMax(max);this.put("tbjiMoneyMax", max);return this;};
			
			
		
			
	 	
			
		
		/** 获得时间 [非空]       **/
		public M tbjiTime(Object tbjiTime){if(proxy)return proxy().tbjiTime(tbjiTime);  this.put("tbjiTime", tbjiTime);return this;};
	 	/** and tbji_time is null */
 		public M tbjiTimeNull(){if(proxy)return proxy().tbjiTimeNull();if(this.get("tbjiTimeNot")==null)this.put("tbjiTimeNot", "");this.put("tbjiTime", null);return this;};
 		/** not .... */
 		public M tbjiTimeNot(){if(proxy)return proxy().tbjiTimeNot();this.put("tbjiTimeNot", "not");return this;};
 		public M tbjiTimeNotNull(){if(proxy)return proxy().tbjiTimeNotNull();this.put("tbjiTimeNot", "not");this.put("tbjiTime", null);return this;};
 		public M tbjiTimeNot(Object tbjiTime){if(proxy)return proxy().tbjiTimeNot(tbjiTime);this.put("tbjiTimeNot", "not");this.put("tbjiTime", tbjiTime);return this;};
	 		
 		/** and tbji_time >= ? */
 		public M tbjiTimeStart(Object start){if(proxy)return proxy().tbjiTimeStart(start);this.put("tbjiTimeStart", start);return this;};			
 		/** and tbji_time <= ? */
 		public M tbjiTimeEnd(Object end){if(proxy)return proxy().tbjiTimeEnd(end);this.put("tbjiTimeEnd", end);return this;};
			
			
		
			
	 	
	 	public M add(String key, Object value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	 	public M add(F key, Object value) {if(proxy)return proxy().add(key,value);this.put(key.toString(), value);return this;}
	 	
	 	public M desc(C key) {if(proxy)return proxy().desc(key);this.put("desc", key.column);return this;}
	 	public M asc(C key) {if(proxy)return proxy().asc(key);this.put("asc", key.column);return this;}
	 	public M desc(String sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	 	public M asc(String sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	 	public M definex(String sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	 	
	 	/** 获取所有经销商收益 **/
		public @api List<TbJxshIncome> list(Integer size){			
			return getTbJxshIncomeList(this,size);
		}
		/** 获取经销商收益分页 **/
		public @api Page<TbJxshIncome> page(Integer page,Integer size){			
			return getTbJxshIncomePage(page, size , this);
		}
		/** 根据查询条件取经销商收益 **/
		public @api TbJxshIncome get(){			
			return getTbJxshIncome(this);
		}
		/** 获取经销商收益数 **/
		public @api Long count(){			
			return getTbJxshIncomeCount(this);
		}
		/** 获取经销商收益表达式 **/
		public @api <T> T eval(String strEval){			
			return getTbJxshIncomeEval(strEval,this);
		}
		
		/** 获取经销商收益统计 **/
		public @api List<Map> stats(C sumKey,C groupKey,int dateType){			
			return getTbJxshIncomeStats(this,sumKey,groupKey,dateType);
		}
		/** 获取经销商收益统计 **/
		public @api List<Map> stats(C sumKey,C groupKey){			
			return getTbJxshIncomeStats(this,sumKey,groupKey,-1);
		}
		
		/** 根据条件更新 **/
		public @api int update(){			
			M where = null;
			M set = null;
			if(this.type==0){
				if(this.linked==null)throw new RuntimeException("未发set");
				where = this;
				set = this.linked;
			}else{
				if(this.linked==null)throw new RuntimeException("未发where条件");
				set = this;
				where = this.linked;
			}
			return updateTbJxshIncome(set,where);
		}
		/** 根据条件删除 **/
		public @api void delete(){			
			deleteTbJxshIncome(this);
		}
	}
	
	public static class Param extends M{
		public Param(int type) {
			super(type);
		}
		public Param(int type, Boolean proxy) {
			super(type, proxy);
		}
	}
	
	/** 对象的字段描述 **/
	public static class F{
		
			
		/** 编号 [非空]       **/
		public final static @type(Long.class)  String tbjiId="tbjiId";
	 			
			
	 	
			
		/** 所属品牌 [非空] [Merchant]      **/
		public final static @type(Long.class)  String tbjiMerchant="tbjiMerchant";
	 			
			
	 	
			
		/** 经销商 [非空] [TbJxsh]      **/
		public final static @type(Long.class)  String tbjiJxsh="tbjiJxsh";
	 			
			
	 	
			
		/** 经销商名称        **/
		public final static @type(String.class) @like String tbjiJxsName="tbjiJxsName";
	 			
			
	 	
			
		/** 订单编号 [非空]       **/
		public final static @type(Long.class)  String tbjiOrderId="tbjiOrderId";
	 			
		/** and tbji_order_id >= ? */
		public final static @type(Long.class) String tbjiOrderIdMin="tbjiOrderIdMin";
		/** and tbji_order_id <= ? */
		public final static @type(Long.class) String tbjiOrderIdMax="tbjiOrderIdMax";
				
			
	 	
			
		/** 订单时间        **/
		public final static @type(Date.class)  String tbjiOrderTime="tbjiOrderTime";
	 			
	 	/** and tbji_order_time >= ? */
 		public final static @type(Date.class) String tbjiOrderTimeStart="tbjiOrderTimeStart";
 		/** and tbji_order_time <= ? */
 		public final static @type(Date.class) String tbjiOrderTimeEnd="tbjiOrderTimeEnd";
				
			
	 	
			
		/** 下单人        **/
		public final static @type(String.class) @like String tbjiMember="tbjiMember";
	 			
			
	 	
			
		/** 配送商        **/
		public final static @type(String.class) @like String tbjiDistributor="tbjiDistributor";
	 			
			
	 	
			
		/** 订单类别    1:直接购买订单 2:余额提货订单     **/
		public final static @type(Short.class)  String tbjiType="tbjiType";
	 			
			
	 	
			
		/** 订单明细    query:goodsNumber text:name menoy:price number:number select:status     **/
		public final static @type(String.class) @like String tbjiOrderDetails="tbjiOrderDetails";
	 			
			
	 	
			
		/** 收益金额 [非空]       **/
		public final static @type(Double.class)  String tbjiMoney="tbjiMoney";
	 			
		/** and tbji_money >= ? */
		public final static @type(Double.class) String tbjiMoneyMin="tbjiMoneyMin";
		/** and tbji_money <= ? */
		public final static @type(Double.class) String tbjiMoneyMax="tbjiMoneyMax";
				
			
	 	
			
		/** 获得时间 [非空]       **/
		public final static @type(Date.class)  String tbjiTime="tbjiTime";
	 			
	 	/** and tbji_time >= ? */
 		public final static @type(Date.class) String tbjiTimeStart="tbjiTimeStart";
 		/** and tbji_time <= ? */
 		public final static @type(Date.class) String tbjiTimeEnd="tbjiTimeEnd";
				
			
	 	
	 	public static String get(String name){
			try {
				Field field = F.class.getField(name);
				if(field!=null)
					return field.get(null).toString();
			} catch (Exception e) {
				//e.printStackTrace();
			}
			return null;
		}
	}
	
	
	
	/** 对象的数据库字段描述 **/
	public static enum C{
		
		tbjiId("tbji_id"),
		tbjiMerchant("tbji_merchant"),
		tbjiJxsh("tbji_jxsh"),
		tbjiJxsName("tbji_jxs_name"),
		tbjiOrderId("tbji_order_id"),
		tbjiOrderTime("tbji_order_time"),
		tbjiMember("tbji_member"),
		tbjiDistributor("tbji_distributor"),
		tbjiType("tbji_type"),
		tbjiOrderDetails("tbji_order_details"),
		tbjiMoney("tbji_money"),
		tbjiTime("tbji_time"),
		count("count");
		String column;
		C(String column){
			this.column = column;
		}
		public String toString(){
			return this.column;
		}
		public static String get(String name){
			try {
				Field field = C.class.getField(name);
				if(field!=null)
					return field.get(null).toString();
			} catch (Exception e) {
				//e.printStackTrace();
			}
			return null;
		}
	}
	
	
	
	
	/**
	* 获取经销商收益数据
	**/
	public static Object getData(Object param){
		if(param==null)
			return null;
		Object value = null;
		if(param.getClass()==Long.class)
			value = TbJxshIncome.get((Long)param);
		else if(param instanceof java.util.Map){
			java.util.Map params = (Map) param;
			if(params.get("size")==null)
				value = TbJxshIncome.getTbJxshIncome(params);
			else
				value = TbJxshIncome.getTbJxshIncomeList(params, (Integer) params.get("size"));
		}else if(param.getClass()==Long.class )
			value =  TbJxshIncome.where().tbjiId(param).get();
		else if(!Utils.empty(param.toString()))
			value = TbJxshIncome.get(Long.valueOf(param.toString()));
		return value;
	}
	
	/**对象转json**/
	public Map toJSON(){
		return toJSON(false);
	}
	public Map toJSON(boolean simple){
		return toJSON(simple,0);
	}
	public Map toJSON(boolean simple,int step){
		Map map = new HashMap();
		map.put("id",this.getTbjiId());
	
		Utils.fms(map,simple?"id":"tbjiId",this.getTbjiId(),this.getTbjiId$());
		
			
 		
	
		Utils.fms(map,simple?"merchant":"tbjiMerchant",this.getTbjiMerchant(),this.getTbjiMerchant$());
		
			
 		
	
		Utils.fms(map,simple?"jxsh":"tbjiJxsh",this.getTbjiJxsh(),this.getTbjiJxsh$());
		
			
 		
	
		Utils.fms(map,simple?"jxsName":"tbjiJxsName",this.getTbjiJxsName(),this.getTbjiJxsName$());
		
			
 		
	
		Utils.fms(map,simple?"orderId":"tbjiOrderId",this.getTbjiOrderId(),this.getTbjiOrderId$());
		
			
 		
	
		Utils.fms(map,simple?"orderTime":"tbjiOrderTime",this.getTbjiOrderTime(),this.getTbjiOrderTime$());
		
			
 		
	
		Utils.fms(map,simple?"member":"tbjiMember",this.getTbjiMember(),this.getTbjiMember$());
		
			
 		
	
		Utils.fms(map,simple?"distributor":"tbjiDistributor",this.getTbjiDistributor(),this.getTbjiDistributor$());
		
			
 		
	
		Utils.fms(map,simple?"type":"tbjiType",this.getTbjiType(),this.getTbjiType$());
		
			
 		
	
		Utils.fms(map,simple?"orderDetails":"tbjiOrderDetails",this.getTbjiOrderDetails(),this.getTbjiOrderDetails$());
		
			
 		
	
		Utils.fms(map,simple?"money":"tbjiMoney",this.getTbjiMoney(),this.getTbjiMoney$());
		
			
 		
	
		Utils.fms(map,simple?"time":"tbjiTime",this.getTbjiTime(),this.getTbjiTime$());
		
			
 		
	
		if(this.suffix!=null)map.put("suffix", this.suffix);
		
		/************LAZY3Q_DEFINE_TOJSON************/
		/************LAZY3Q_DEFINE_TOJSON************/
		return map;
	}
	/**对象转map**/
	public Map toMap(){
		Map map = new HashMap();
	
		map.put("tbjiId",this.getTbjiId());
 		
	
		map.put("tbjiMerchant",this.getTbjiMerchant());
 		
	
		map.put("tbjiJxsh",this.getTbjiJxsh());
 		
	
		map.put("tbjiJxsName",this.getTbjiJxsName());
 		
	
		map.put("tbjiOrderId",this.getTbjiOrderId());
 		
	
		map.put("tbjiOrderTime",this.getTbjiOrderTime());
 		
	
		map.put("tbjiMember",this.getTbjiMember());
 		
	
		map.put("tbjiDistributor",this.getTbjiDistributor());
 		
	
		map.put("tbjiType",this.getTbjiType());
 		
	
		map.put("tbjiOrderDetails",this.getTbjiOrderDetails());
 		
	
		map.put("tbjiMoney",this.getTbjiMoney());
 		
	
		map.put("tbjiTime",this.getTbjiTime());
 		
	
		map.put("suffix", this.suffix);
		
		/************LAZY3Q_DEFINE_TOMAP************/
		/************LAZY3Q_DEFINE_TOMAP************/
		return map;
	}
	/**map转对象**/
	public static TbJxshIncome fromMap(Map map){
		TbJxshIncome tbJxshIncome = new TbJxshIncome();
	
		tbJxshIncome.tbjiId = Utils.parseLong(map.get("tbjiId"));
 		
	
		tbJxshIncome.tbjiMerchant = Utils.parseLong(map.get("tbjiMerchant"));
 		
	
		tbJxshIncome.tbjiJxsh = Utils.parseLong(map.get("tbjiJxsh"));
 		
	
		tbJxshIncome.tbjiJxsName = Utils.parseString(map.get("tbjiJxsName"));
 		
	
		tbJxshIncome.tbjiOrderId = Utils.parseLong(map.get("tbjiOrderId"));
 		
	
		tbJxshIncome.tbjiOrderTime = Utils.parseDate(map.get("tbjiOrderTime"));
 		
	
		tbJxshIncome.tbjiMember = Utils.parseString(map.get("tbjiMember"));
 		
	
		tbJxshIncome.tbjiDistributor = Utils.parseString(map.get("tbjiDistributor"));
 		
	
		tbJxshIncome.tbjiType = Utils.parseShort(map.get("tbjiType"));
 		
	
		tbJxshIncome.tbjiOrderDetails = Utils.parseString(map.get("tbjiOrderDetails"));
 		
	
		tbJxshIncome.tbjiMoney = Utils.parseDouble(map.get("tbjiMoney"));
 		
	
		tbJxshIncome.tbjiTime = Utils.parseDate(map.get("tbjiTime"));
 		
	
		return tbJxshIncome;
	}
	
	
	/**字段设置标记队列**/
	private Map<String,Boolean> seted=new HashMap();
	public Boolean getSeted(String key){
		return seted.get(key);
	}
	public void setSeted(String key){
		seted.put(key,true);
	}
	/**同步未set的字段**/
	public void mergeSet(TbJxshIncome old){
		Field[] fields = this.getClass().getDeclaredFields();
		try {
			for(Field field:fields){
				String key = field.getName();
				if(seted.get(key)==null && field.getAnnotation(column.class)!=null){
					field.setAccessible(true);
					field.set(this, field.get(old));					
				}
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	
		
	/**自定义变量存储**/
	private Map values=new HashMap();
	public Map getValues(){
		return values;
	}
	public void setValues(String name,Object value){
		values.put(name,value);
	}
	
	/**分表时的表名后缀**/
	private String suffix;
	public String getSuffix() {
		return suffix;
	}
	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}
	
	
	/**获取数据库名称**/
	public static String getDataBaseName(){
		return Utils.config("spring.datasource.distribute_sys.name");
	}
	
	
	public static String getIcon(){
		return "/images/icons/20088256422923477806.png";
	}
	public static String getIconfont(){
		return "icon-jiagebaohu";
	}
	public static enum ACT{
		列表,添加,修改,详情
	};
	public static String getUrl(ACT act,TbJxshIncome.M params){
		if(params==null)params=new TbJxshIncome.M(0);
		params.remove("joins");
		params.remove("definexs");
		params.remove("distinct");
		String strUrl = "/admin/finance/jxshincome.edit.html?";
		if(params.get("tbjiId")!=null){
			strUrl+="&id="+Utils.encode(""+params.get("tbjiId"),Utils.UTF8);
		}
		if(act==ACT.列表){
			strUrl = "/admin/finance/jxshincome.html?1=1";
		
		}else if(act==ACT.添加){
			strUrl+="&edittype=insert";
		
		
		}else if(act==ACT.修改){
			strUrl+="&edittype=update";
		
		}else if(act==ACT.详情){
			strUrl+="&edittype=detail";
		
		}		
		if(params!=null){
			for(Object key:params.keySet()){
				strUrl+="&"+key+"="+Utils.encode(""+params.get(key),Utils.UTF8)+"";
			}
		}
		return strUrl;
	}
	public String getDetailUrl(){
		return this.getUrl(ACT.详情, where.tbjiId(this.getId()));
	}
	
	/**
	* 转跳到当前地址
	**/
	public static Protocol redirect(TbJxshIncome.ACT act,TbJxshIncome.M params){
		Protocol protocol = Protocol.create(true,null,"ACT_REDIRECT");
		protocol.set("url",TbJxshIncome.getUrl(act, params));
		return protocol;
	}
	/**
	* 打开一个新的tab页面
	**/
	public static Protocol href(TbJxshIncome.ACT act,TbJxshIncome.M params){
		Protocol protocol = Protocol.create(true,null,"ACT_HREF");
		protocol.set("url",TbJxshIncome.getUrl(act, params));
		protocol.set("title",act.name());
		return protocol;
	}
	/**
	* 显示一个消息框，并且关闭当前的对话框
	**/
	public static Protocol message(String message){
		Protocol protocol = Protocol.create(true,null,"ACT_MESSAGE");
		protocol.set("message",message);
		return protocol;
	}
	
	
	static com.distribute.framework.dao.ITbJxshIncomeDao getTbJxshIncomeDao(){
		return Utils.getBean("tbJxshIncomeDao");
	};
	
}